import globals from "globals";
import pluginJs from "@eslint/js";
import pluginVue from "eslint-plugin-vue";
import eslintConfigPrettier from "eslint-config-prettier";
import unocss from "@unocss/eslint-config/flat";
import tseslint from "typescript-eslint";

export default [
  { files: ["**/*.{js,mjs,cjs,vue,jsx}"] },
  {
    languageOptions: {
      globals: {
        ...globals.browser,
        ...globals.node,
      },
      parser: pluginJs.parser,
      parserOptions: {
        parser: tseslint.parser,
      },
    },
  },
  pluginJs.configs.recommended,
  ...tseslint.configs.recommended,
  ...pluginVue.configs["flat/essential"],
  unocss,
  eslintConfigPrettier,
  {
    rules: {
      "no-undef": "warn",
      "no-unused-vars": "warn",
      "vue/multi-word-component-names": "off",
      "@unocss/<rule-name>": "off",
      "@typescript-eslint/no-unused-vars": "warn",
    },
  },
  {
    ignores: [],
  },
];
